import request from '@/utils/request'

export function getChatList(query) {
  return request({
    url: '/chat/log',
    method: 'get',
    params: query
  })
}

export function getBlockWord() {
  return request({
    url: '/chat/blockword',
    method: 'get'
  })
}

export function handleBlockWord(data) {
  return request({
    url: '/chat/blockword',
    method: 'post',
    params: data
  })
}

export function getNumbWord() {
  return request({
    url: '/chat/numbword',
    method: 'get'
  })
}

export function handleNumbWord(data) {
  return request({
    url: '/chat/numbword',
    method: 'post',
    params: data
  })
}

export function clearChat(data) {
  return request({
    url: '/chat/clear',
    method: 'post',
    params: data
  })
}

export function clearChatNumbWord(data) {
  return request({
    url: '/chat/numbword/clear',
    method: 'post',
    params: data
  })
}

export function banActor(data) {
  return request({
    url: '/ban/actor',
    method: 'post',
    params: data
  })
}

export function banAccount(data) {
  return request({
    url: '/ban/account',
    method: 'post',
    params: data
  })
}

export function getLastIp(actorId) {
  return request({
    url: `/ban/ip/actor/${actorId}`,
    method: 'get'
  })
}

export function ban(data) {
  return request({
    url: '/ban',
    method: 'post',
    params: data
  })
}

export function getBanList(query) {
  return request({
    url: '/ban/list',
    method: 'get',
    params: query
  })
}

export function unban(data) {
  return request({
    url: '/unban',
    method: 'post',
    params: data
  })
}

export function checkTarget(data) {
  return request({
    url: '/ban/check/target',
    method: 'post',
    params: data
  })
}

export function getWhitelist(query) {
  return request({
    url: '/chat/whitelist/list',
    method: 'get',
    params: query
  })
}

export function handleWhitelist(data) {
  return request({
    url: '/chat/whitelist/handle',
    method: 'post',
    params: data
  })
}

export function deleteWhitelist(id) {
  return request({
    url: `/chat/whitelist/${id}`,
    method: 'delete'
  })
}

export function batchDeleteWhitelist(data) {
  return request({
    url: '/chat/whitelist/batchDelete',
    method: 'post',
    params: data
  })
}

export function getMonitorLog(query) {
  return request({
    url: '/monitor/list',
    method: 'get',
    params: query
  })
}

export function unbanActor(data) {
  return request({
    url: '/monitor/unban/actor',
    method: 'post',
    params: data
  })
}

export function getKeyword(query) {
  return request({
    url: '/monitor/keyword',
    method: 'get',
    params: query
  })
}

export function handleKeyword(data) {
  return request({
    url: '/monitor/keyword',
    method: 'post',
    params: data
  })
}

export function getMonitorRuleList(query) {
  return request({
    url: '/monitor/rule/list',
    method: 'get',
    params: query
  })
}

export function handleMonitorRule(data) {
  return request({
    url: '/monitor/rule/handle',
    method: 'post',
    params: data
  })
}

export function deleteMonitorRule(id) {
  return request({
    url: `/monitor/rule/${id}`,
    method: 'delete'
  })
}
